<template>
  <el-table :data="stus" style="width: 100%">
    <el-table-column type="expand">
      <template #default="props">
        <div m="4">
          <p m="t-0 b-2">结果: {{ props.row.result }}</p>
        </div>
      </template>
    </el-table-column>
    <el-table-column label="Date" prop="stu_id" />
    <el-table-column label="Name" prop="stu_name" />
  </el-table>
</template>

<script lang="ts" setup>
import { request } from "@/utils/service"
import { ref } from "vue"
import { useUserStore } from "@/store/modules/user"
type student = {
  stu_id: string
  stu_name: string
  result: string
}
const stus = ref<student[]>([])
const username = useUserStore().username
request({
  url: "/students/" + username,
  method: "get"
}).then((resp) => {
  stus.value = resp.data.students
  console.log(stus)
})
</script>
